/ @Author= Alaa Shafaee
/ @Summary= This view lists the names of all admins together with their emails.
/           A delete button is added next to each admin.
/           Pagination is used here where the maximum number of admins per page is 10
%p
%h1
	Admins

- i=1
%table.table.table-striped
	%thead
		%tr
			%th #
			%th Name
			%th Email
	%tbody
		-if(@admins.empty?)
			%tr
				%td				
					%p No Admins at the moment.
		-else
			- @admins.each do |admin|
				-if(admin.deleted)
					-next
				-else
					%tr
						%td= i
						%td
							%p= admin.name
						%td
							%p= admin.email 
						-if(!current_admin.nil? && current_admin.isSuperAdmin == true && current_admin.name != admin.name)
							%td 
								= button_to 'Delete', admin_path(admin), :method => 'delete', :confirm => 'Are you sure you want to delete this admin?', :admin_id => admin.id
						-else
							%td
								%p
						-i = i+1
= will_paginate @admins
